package com.kou.controller;/**
 * @author SteinY
 * @create 2022-03-28 16:46
 * @description:
 */

import com.kou.service.OrderService;
import com.kou.service.impl.OrderServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * projectName:myshop2
 * author:SteinY
 * time:2022/3/28 16:46
 * description:
 */
@WebServlet("/sendOrder")
public class SendOrder extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String oid = request.getParameter("oid");
        OrderService orderService = new OrderServiceImpl();
        orderService.send(oid);
        response.sendRedirect("/admin/showAllOrder.jsp");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}